package com.dlyk.result;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 返回给前端的结果码和结果信息
 */
@Getter
@AllArgsConstructor
public enum CodeEnum {

    OK(200, "成功"),

    FAIL(500, "失败"),

    TOKEN_IS_EMPTY(901, "请求token参数为空"),

    TOKEN_IS_ERROR(902, "请求token有误"),

    TOKEN_IS_EXPIRED(903, "请求token已过期"),

    USER_LOGOUT(200, "退出成功"),

    REDIS_TOKEN_DELETE_FAIL(500, "redis中的token删除失败"),

    DATA_ACCESS_EXCEPTION(500, "数据库操作失败，该数据可能被引用，无法删除"),

    PASSWORD_VERIFY_FAIL_EXCEPTION(500, "密码验证未通过"),

    ACCESS_DENIED(500, "权限不足");

    // 结果码
    private int code;

    // 结果信息
    private String msg;

}

